package com.px.baolaiapi.controller;


import com.px.common.api.CommonResult;
import com.px.mbg.model.DrDetail;
import com.px.baolaiapi.service.IDrDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 调入单明细 前端控制器
 * </p>
 *
 * @author 品讯科技
 * @since 2022-03-25
 */
@Api(tags = "调入单详情api")
@RestController
@RequestMapping("/dr-detail")
public class DrDetailController {

    @Autowired
    IDrDetailService drDetailService;

    @ApiOperation("添加调入明细单")
    @PostMapping("/addDrDetail")
    public CommonResult addDrDetail(@RequestBody @Validated DrDetail drDetail){
        return CommonResult.success(drDetailService.save(drDetail));
    }
    @ApiOperation("修改&&删除调入明细单")
    @PostMapping("/updateDrDetail")
    public CommonResult updateDrDetail(@RequestBody DrDetail drDetail){
        return CommonResult.success(drDetailService.updateById(drDetail));
    }


}
